import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.SQLException;
public class test
{
    public static void main(String[] args) throws SQLException
    {
        long a = 2180400511L;
        System.out.println(a);
        System.out.println(Integer.MAX_VALUE);
        Connection connection = null;
        Statement statement = null;
        try
        {
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            System.out.println("connecting database");
            connection = DriverManager.getConnection("jdbc:sqlserver://localhost;DatabaseName=evaluations_of_teachers", "xiF616", "L'hospital");
            System.out.println("new statement");
            statement = connection.createStatement();
            ResultSet result = statement.executeQuery("select code, password, 2021 - start_year from student");
            while (result.next())
            {
                System.out.println(
                        "code = " + result.getLong("code")
                        + ", password = " + result.getString("password").trim()
                        + ", grade = " + result.getInt(3));
            }
            result.close();
            statement.close();
            connection.close();
        }
        catch (ClassNotFoundException | SQLException e)
        {
            e.printStackTrace();
        }
        finally
        {
            try
            {
                if (statement != null)
                    statement.close();
            }
            catch (SQLException ignored)
            {}
            if (connection != null)
                connection.close();
        }
    }
}
